import request from '@/utils/request'

export function getAllcheckMessage() {
  return request({
    url: '/CheckMessage/selectAll',
    method: 'get'
  })
}
export function updatecheckMessage(checkMessage) {
  return request({
    url: '/CheckMessage/updateByPrimaryKeySelective',
    method: 'put',
    params: {
      checkMessageId: checkMessage.checkMessageId, // 考勤信息编号
      checkAttendanceId: checkMessage.checkAttendanceId, // 所属考勤编号
      checkUserId: checkMessage.checkUserId, // 考勤人员编号
      checkUserName: checkMessage.checkUserName, // 考勤人员名字
      checkType: checkMessage.checkType, // 考勤类型
      checkScore: checkMessage.checkScore, // 考勤分数
      checkCreateTime: checkMessage.checkCreateTime // 考勤分数
    }
  })
}

export function deletecheckMessage(checkMessageId) {
  return request({
    url: '/CheckMessage/deleteByPrimaryKey',
    method: 'post',
    params: {
      checkMessageId: checkMessageId
    }
  })
}

export function getcheckMessageById(checkMessageId) {
  return request({
    url: '/CheckMessage/selectById',
    method: 'get',
    params: {
      checkMessageId: checkMessageId
    }
  })
}

export function addessay(checkMessage) {
  return request({
    url: '/CheckMessage/insertSelective',
    method: 'post',
    params: {
      checkAttendanceId: checkMessage.checkAttendanceId, // 所属考勤编号
      checkUserId: checkMessage.checkUserId, // 考勤人员编号
      checkUserName: checkMessage.checkUserName, // 考勤人员名字
      checkType: checkMessage.checkType, // 考勤类型
      checkScore: checkMessage.checkScore // 考勤分数
    }
  })
}

export function getAttendanceByCheckId(checkAttendanceId) {
  return request({
    url: '/CheckMessage/selectBy',
    method: 'get',
    params: {
      checkAttendanceId: checkAttendanceId
    }
  })
}

export function updateMessage(check) {
  return request({
    url: '/CheckMessage/updateByPrimaryKeySelective',
    method: 'put',
    params: {
      checkMessageId: check.checkMessageId,
      checkScore: check.checkScore,
      checkType: check.checkType
    }
  })
}

